<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <script src="__STATIC__/js/jquery-3.3.1.js" type="application/javascript"></script>
    <script src="__STATIC__/layui/layui.all.js" type="application/javascript"></script>
    <link href="__STATIC__/layui/css/layui.css" type="text/css" rel="stylesheet">
    <style>
        .layui-input, .layui-textarea{
            width: 90%;
        }
        fieldset{
            margin-top: 19px !important;
        }
        .layui-form-label{
            width: 100px;
        }
        #pic{
            margin-top: 8px;
        }
    </style>
</head>
<body>
    <fieldset  class="layui-elem-field layui-field-title" style="margin-top: 50px;">
        <legend>奖品信息</legend>
    </fieldset>
    <form class="layui-form" id="from" action="{:url('form/addj')}"  method="post" enctype="multipart/form-data">
        <div class="layui-form-item">
            <label class="layui-form-label">奖品名称</label>
            <div class="layui-input-block">
                <input type="text" name="p_name" placeholder="请输入名称" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">奖品图片</label>
            <div class="layui-input-block">
                <input type="file" name="p_picture" id="pic" >
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">奖品所需积分</label>
            <div class="layui-input-block">
                <input type="text" name="p_integral"  class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">每天兑奖数量</label>
            <div class="layui-input-block">
                <input type="text" name="p_total_awards" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">奖品账号</label>
            <div class="layui-input-block">
                <input type="text" name="p_account" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">奖品密码</label>
            <div class="layui-input-block">
                <input type="text" name="p_pwd" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="button" class="layui-btn" >立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</body>
<script src="/static/js/maowenke.js"></script>
<script>
    $("[type=button]").click(function () {
        ajaxImage($("#from"),"{:url('form/addj')}",function (data) {
            if(data==1){
                var index=parent.layer.getFrameIndex(window.name);
                parent.layer.close(index);
            }else{
                layer.msg(data)
            }
        })
    });
</script>
</html>
</body>
</html>